home *** CD-ROM | disk | FTP | other *** search
- Path: erich.triumf.ca!bennett
- From: bennett@erich.triumf.ca (P.Bennett)
- Newsgroups: comp.lang.c
- Subject: Re: Keyboard buffer problems...please help!
- Date: 18 Feb 1996 09:22 PST
- Organization: TRIUMF: Tri-University Meson Facility
- Distribution: world
- Message-ID: <18FEB199609221151@erich.triumf.ca>
- References: <3126B507.4052@canna.ucsd.edu>
- NNTP-Posting-Host: ftp.triumf.ca
- News-Software: VAX/VMS VNEWS 1.50
-
- In article <3126B507.4052@canna.ucsd.edu>, "Eric C. Liebl" <ecl@canna.ucsd.edu> writes...
- >I am looking for a C command that will flush the keyboard buffer before
- >it is read. I am using Borland C/C++ 4.0 to compile my program.
- >Basically, I have a do while loop with getch() initiated when kbhit is
- >true...when an appropriate key is hit I update graphics, etc. in my
- >program. However, if a user holds the key down the key data fills the
- >keyboard buffer and I get an annoying beep and too many "moves" get
- >stored up in advance.
-
- You might do better asking this in an MS-DOS newsgroup, like
- comp.os.msdos.programmer, since the C language doesn't provide anything to help
- you (the results of fflush() are undefined for input streams)
-
- There is a byte somewhere that indicates when a key is pressed or released,
- which may be useful (I don't have the address handy...)
-
- Peter Bennett VE7CEI | Vessels shall be deemed to be in sight
- Internet: bennett@triumf.ca | of one another only when one can be
- Packet: ve7cei@ve7kit.#vanc.bc.ca | observed visually from the other
- TRIUMF, Vancouver, B.C., Canada | ColRegs 3(k)
- GPS and NMEA info and programs: ftp://sundae.triumf.ca/pub/peter/index.html
-
-
-
-
-
-
-